#include "ICameraDiagServlet.h" 
#include "Archive.h"
#include "IServlet.h"
const char *ICameraDiagServlet::__businessName__="ICameraDiagServlet";
struct ICameraDiagServlet_openCamera_proto {
};
struct ICameraDiagServlet_stopCamera_proto {
};
IMP_SERIALIZE_OBJECT(ICameraDiagServlet_openCamera_proto) {
};
IMP_SERIALIZE_OBJECT(ICameraDiagServlet_stopCamera_proto) {
};
void ICameraDiagServlet::openCamera(IServlet *servlet ) {
    ICameraDiagServlet_openCamera_proto __iner__proto;
    std::string __proto_name__ = "ICameraDiagServlet::openCamera";
    ByteArray *out = NULL;
    Stream ss(__iner__proto,&out);
    int size = out->size();
    std::string __content;
    __content.resize(size+4+__proto_name__.size()); {
    int intS = __proto_name__.size(); memcpy(&__content[0],&intS,4);
    memcpy(&__content[4],&__proto_name__[0],__proto_name__.size());
    memcpy(&__content[4+intS],out->pointer() , size);
    servlet->request(&__content[0], __content.size());
    }
}
void ICameraDiagServlet::stopCamera(IServlet *servlet ) {
    ICameraDiagServlet_stopCamera_proto __iner__proto;
    std::string __proto_name__ = "ICameraDiagServlet::stopCamera";
    ByteArray *out = NULL;
    Stream ss(__iner__proto,&out);
    int size = out->size();
    std::string __content;
    __content.resize(size+4+__proto_name__.size()); {
    int intS = __proto_name__.size(); memcpy(&__content[0],&intS,4);
    memcpy(&__content[4],&__proto_name__[0],__proto_name__.size());
    memcpy(&__content[4+intS],out->pointer() , size);
    servlet->request(&__content[0], __content.size());
    }
}
int ICameraDiagServlet::dispatchActions(ISession *session,void *data,int size) {
    std::string name;
    int strS = *(int*)data;
    name.resize(strS);
    memcpy(&name[0],((char*)data)+4,strS);
   if (name == "ICameraDiagServlet::openCamera") {
        ICameraDiagServlet_openCamera_proto __iner__proto;
    	Stream ss(__iner__proto,((unsigned char*)data)+(strS+4),size - 4 - strS);		
        openCamera(session);
   }
   else if (name == "ICameraDiagServlet::stopCamera") {
        ICameraDiagServlet_stopCamera_proto __iner__proto;
    	Stream ss(__iner__proto,((unsigned char*)data)+(strS+4),size - 4 - strS);		
        stopCamera(session);
   }
    return 0;
}
const char *ICameraDiagServlet4Test::__businessName__="ICameraDiagServlet4Test";
struct ICameraDiagServlet4Test_openCamera4Test_proto {
    int x;
    int y;
};
struct ICameraDiagServlet4Test_openCamera4TestString_proto {
    int x;
    std::string content;
};
struct ICameraDiagServlet4Test_openCamera4TestVector_proto {
    std::vector<std::string> content;
};
IMP_SERIALIZE_OBJECT(ICameraDiagServlet4Test_openCamera4Test_proto) {
    BIND_SERIALIZE(x, 0);
    BIND_SERIALIZE(y, 1);
};
IMP_SERIALIZE_OBJECT(ICameraDiagServlet4Test_openCamera4TestString_proto) {
    BIND_SERIALIZE(x, 0);
    BIND_SERIALIZE(content, 1);
};
IMP_SERIALIZE_OBJECT(ICameraDiagServlet4Test_openCamera4TestVector_proto) {
    BIND_SERIALIZE(content, 0);
};
void ICameraDiagServlet4Test::openCamera4Test(IServlet *servlet ,const int& x,const int& y) {
    ICameraDiagServlet4Test_openCamera4Test_proto __iner__proto;
    std::string __proto_name__ = "ICameraDiagServlet4Test::openCamera4Test";
    __iner__proto.x=x; 
    __iner__proto.y=y; 
    ByteArray *out = NULL;
    Stream ss(__iner__proto,&out);
    int size = out->size();
    std::string __content;
    __content.resize(size+4+__proto_name__.size()); {
    int intS = __proto_name__.size(); memcpy(&__content[0],&intS,4);
    memcpy(&__content[4],&__proto_name__[0],__proto_name__.size());
    memcpy(&__content[4+intS],out->pointer() , size);
    servlet->request(&__content[0], __content.size());
    }
}
void ICameraDiagServlet4Test::openCamera4TestString(IServlet *servlet ,const int& x,const std::string& content) {
    ICameraDiagServlet4Test_openCamera4TestString_proto __iner__proto;
    std::string __proto_name__ = "ICameraDiagServlet4Test::openCamera4TestString";
    __iner__proto.x=x; 
    __iner__proto.content=content; 
    ByteArray *out = NULL;
    Stream ss(__iner__proto,&out);
    int size = out->size();
    std::string __content;
    __content.resize(size+4+__proto_name__.size()); {
    int intS = __proto_name__.size(); memcpy(&__content[0],&intS,4);
    memcpy(&__content[4],&__proto_name__[0],__proto_name__.size());
    memcpy(&__content[4+intS],out->pointer() , size);
    servlet->request(&__content[0], __content.size());
    }
}
void ICameraDiagServlet4Test::openCamera4TestVector(IServlet *servlet ,const std::vector<std::string>& content) {
    ICameraDiagServlet4Test_openCamera4TestVector_proto __iner__proto;
    std::string __proto_name__ = "ICameraDiagServlet4Test::openCamera4TestVector";
    __iner__proto.content=content; 
    ByteArray *out = NULL;
    Stream ss(__iner__proto,&out);
    int size = out->size();
    std::string __content;
    __content.resize(size+4+__proto_name__.size()); {
    int intS = __proto_name__.size(); memcpy(&__content[0],&intS,4);
    memcpy(&__content[4],&__proto_name__[0],__proto_name__.size());
    memcpy(&__content[4+intS],out->pointer() , size);
    servlet->request(&__content[0], __content.size());
    }
}
int ICameraDiagServlet4Test::dispatchActions(ISession *session,void *data,int size) {
    std::string name;
    int strS = *(int*)data;
    name.resize(strS);
    memcpy(&name[0],((char*)data)+4,strS);
   if (name == "ICameraDiagServlet4Test::openCamera4Test") {
        ICameraDiagServlet4Test_openCamera4Test_proto __iner__proto;
    	Stream ss(__iner__proto,((unsigned char*)data)+(strS+4),size - 4 - strS);		
        openCamera4Test(session,__iner__proto.x, __iner__proto.y);
   }
   else if (name == "ICameraDiagServlet4Test::openCamera4TestString") {
        ICameraDiagServlet4Test_openCamera4TestString_proto __iner__proto;
    	Stream ss(__iner__proto,((unsigned char*)data)+(strS+4),size - 4 - strS);		
        openCamera4TestString(session,__iner__proto.x, __iner__proto.content);
   }
   else if (name == "ICameraDiagServlet4Test::openCamera4TestVector") {
        ICameraDiagServlet4Test_openCamera4TestVector_proto __iner__proto;
    	Stream ss(__iner__proto,((unsigned char*)data)+(strS+4),size - 4 - strS);		
        openCamera4TestVector(session,__iner__proto.content);
   }
    return 0;
}
